<?php

/**
 * Subclass for performing query and update operations on the 'member' table.
 *
 *
 *
 * @package lib.model
 */
class MemberPeer extends BaseMemberPeer
{
    static public function getPager($perpage, $page, $parameters)
    {
        $c = new Criteria();
        $c->addDescendingOrderByColumn(self::CREATED_AT);
        $pager = new sfPropelPager('Member', $perpage);
        $pager->setCriteria($c);
        $pager->setPage($page);
        $pager->init();
        return $pager;
    }

    static public function getAllMemberKeyName($del = "")
    {
        $c = new Criteria();
        if($del != ""){
            //TODO
        }else{
            $c->add(self::DELETE_YN, "y", Criteria::NOT_EQUAL);
        }
        $member_objs = self::doSelect($c);
        $members = array();
        foreach($member_objs as $member_obj){
            $members[$member_obj->getId()] = $member_obj->getName();
        }
        return $members;
    }
}
